/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.fatecmm.limiar.visao.gui;

import javax.swing.JFrame;

/**
 *
 * @author michel
 */
public class GUIPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form GUIPrincipal
     */
    public GUIPrincipal() {
        initComponents();
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        desktopPane = new javax.swing.JDesktopPane();
        jPanel1 = new javax.swing.JPanel();
        lblImagem = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        menuArquivo = new javax.swing.JMenu();
        itemDeMenuAbrir = new javax.swing.JMenuItem();
        itemDeMenuSalvar = new javax.swing.JMenuItem();
        itemDeMenuSair = new javax.swing.JMenuItem();
        menuSetores = new javax.swing.JMenu();
        itemDeMenuCadastrarSetor = new javax.swing.JMenuItem();
        itemDeMenuConsultarSetor = new javax.swing.JMenuItem();
        menuFuncionarios = new javax.swing.JMenu();
        itemDeMenuCadastrarFuncionario = new javax.swing.JMenuItem();
        itemDeMenuConsultarFuncionario = new javax.swing.JMenuItem();
        menuClientes = new javax.swing.JMenu();
        subMenuCadastrarCliente = new javax.swing.JMenu();
        itemDeMenuCadastrarClientePessoaFisica = new javax.swing.JMenuItem();
        itemDeMenuCadastrarClientePessoaJuridica = new javax.swing.JMenuItem();
        itemDeMenuConsultarCliente = new javax.swing.JMenuItem();
        menuImoveis = new javax.swing.JMenu();
        menuObras = new javax.swing.JMenu();
        itemDeMenuIncluirObra = new javax.swing.JMenuItem();
        itemDeMenuStatusObra = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        menuInternoDeInsumosNasObras = new javax.swing.JMenu();
        itemDeMenuBaixaDeInsumos = new javax.swing.JMenuItem();
        itemDeMenuConsultaDeInsumos = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Construtora Limiar");

        lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/edu/fatecmm/limiar/media/construtora limiar - novo.jpg"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblImagem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(20, 20, 20))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblImagem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(29, 29, 29))
        );

        jPanel1.setBounds(0, 0, 512, 641);
        desktopPane.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        menuArquivo.setMnemonic('a');
        menuArquivo.setText("Arquivo");

        itemDeMenuAbrir.setMnemonic('a');
        itemDeMenuAbrir.setText("Abrir");
        menuArquivo.add(itemDeMenuAbrir);

        itemDeMenuSalvar.setMnemonic('s');
        itemDeMenuSalvar.setText("Salvar");
        menuArquivo.add(itemDeMenuSalvar);

        itemDeMenuSair.setMnemonic('x');
        itemDeMenuSair.setText("Sair (x)");
        itemDeMenuSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuSairActionPerformed(evt);
            }
        });
        menuArquivo.add(itemDeMenuSair);

        menuBar.add(menuArquivo);

        menuSetores.setMnemonic('s');
        menuSetores.setText("Setores");

        itemDeMenuCadastrarSetor.setMnemonic('i');
        itemDeMenuCadastrarSetor.setText("Cadastrar");
        itemDeMenuCadastrarSetor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuCadastrarSetorActionPerformed(evt);
            }
        });
        menuSetores.add(itemDeMenuCadastrarSetor);

        itemDeMenuConsultarSetor.setMnemonic('c');
        itemDeMenuConsultarSetor.setText("Consultar");
        itemDeMenuConsultarSetor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuConsultarSetorActionPerformed(evt);
            }
        });
        menuSetores.add(itemDeMenuConsultarSetor);

        menuBar.add(menuSetores);

        menuFuncionarios.setMnemonic('f');
        menuFuncionarios.setText("Funcionários");

        itemDeMenuCadastrarFuncionario.setMnemonic('c');
        itemDeMenuCadastrarFuncionario.setText("Cadastrar");
        itemDeMenuCadastrarFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuCadastrarFuncionarioActionPerformed(evt);
            }
        });
        menuFuncionarios.add(itemDeMenuCadastrarFuncionario);

        itemDeMenuConsultarFuncionario.setMnemonic('a');
        itemDeMenuConsultarFuncionario.setText("Consultar");
        menuFuncionarios.add(itemDeMenuConsultarFuncionario);

        menuBar.add(menuFuncionarios);

        menuClientes.setMnemonic('c');
        menuClientes.setText("Clientes");

        subMenuCadastrarCliente.setText("Cadastrar");

        itemDeMenuCadastrarClientePessoaFisica.setMnemonic('i');
        itemDeMenuCadastrarClientePessoaFisica.setText("Pessoa Fisica");
        itemDeMenuCadastrarClientePessoaFisica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuCadastrarClientePessoaFisicaActionPerformed(evt);
            }
        });
        subMenuCadastrarCliente.add(itemDeMenuCadastrarClientePessoaFisica);

        itemDeMenuCadastrarClientePessoaJuridica.setText("PessoaJuridica");
        itemDeMenuCadastrarClientePessoaJuridica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuCadastrarClientePessoaJuridicaActionPerformed(evt);
            }
        });
        subMenuCadastrarCliente.add(itemDeMenuCadastrarClientePessoaJuridica);

        menuClientes.add(subMenuCadastrarCliente);

        itemDeMenuConsultarCliente.setMnemonic('c');
        itemDeMenuConsultarCliente.setText("Consultar");
        itemDeMenuConsultarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemDeMenuConsultarClienteActionPerformed(evt);
            }
        });
        menuClientes.add(itemDeMenuConsultarCliente);

        menuBar.add(menuClientes);

        menuImoveis.setMnemonic('i');
        menuImoveis.setText("Imóveis");
        menuBar.add(menuImoveis);

        menuObras.setMnemonic('o');
        menuObras.setText("Obras");

        itemDeMenuIncluirObra.setMnemonic('i');
        itemDeMenuIncluirObra.setText("Incluir");
        menuObras.add(itemDeMenuIncluirObra);

        itemDeMenuStatusObra.setMnemonic('s');
        itemDeMenuStatusObra.setText("Status");
        menuObras.add(itemDeMenuStatusObra);
        menuObras.add(jSeparator3);

        menuInternoDeInsumosNasObras.setMnemonic('n');
        menuInternoDeInsumosNasObras.setText("Insumos");

        itemDeMenuBaixaDeInsumos.setMnemonic('b');
        itemDeMenuBaixaDeInsumos.setText("Baixa de Insumos");
        menuInternoDeInsumosNasObras.add(itemDeMenuBaixaDeInsumos);

        itemDeMenuConsultaDeInsumos.setMnemonic('c');
        itemDeMenuConsultaDeInsumos.setText("Consulta de Insumos");
        menuInternoDeInsumosNasObras.add(itemDeMenuConsultaDeInsumos);

        menuObras.add(menuInternoDeInsumosNasObras);

        menuBar.add(menuObras);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void itemDeMenuSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuSairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_itemDeMenuSairActionPerformed

    private void itemDeMenuCadastrarClientePessoaFisicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuCadastrarClientePessoaFisicaActionPerformed
        if ((guiCadastroDeClientePessoaFisica == null) || (!guiCadastroDeClientePessoaFisica.isVisible())) {
            guiCadastroDeClientePessoaFisica = new GUICadastroDeClientePessoaFisica();
            desktopPane.add(guiCadastroDeClientePessoaFisica);
            //guiCadastroDeCliente.setPosicao();
            guiCadastroDeClientePessoaFisica.setVisible(true);
}

    }//GEN-LAST:event_itemDeMenuCadastrarClientePessoaFisicaActionPerformed

    private void itemDeMenuConsultarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuConsultarClienteActionPerformed
        if((guiConsultaDeCliente == null) || (!guiConsultaDeCliente.isVisible())){
            guiConsultaDeCliente = new GUIConsultaDeCliente();
            desktopPane.add(guiConsultaDeCliente);
            guiConsultaDeCliente.setVisible(true);
        }
            
    }//GEN-LAST:event_itemDeMenuConsultarClienteActionPerformed

    private void itemDeMenuCadastrarSetorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuCadastrarSetorActionPerformed
        
        if((guiCadastroDeSetor == null) || (!guiCadastroDeSetor.isVisible())){
            guiCadastroDeSetor = new GUICadastroDeSetor();
            desktopPane.add(guiCadastroDeSetor);
            guiCadastroDeSetor.setVisible(true);
        }
    }//GEN-LAST:event_itemDeMenuCadastrarSetorActionPerformed

    private void itemDeMenuConsultarSetorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuConsultarSetorActionPerformed

        if((guiConsultaDeSetor == null) || (!guiConsultaDeSetor.isVisible())){
            guiConsultaDeSetor = new GUIConsultaDeSetor();
            desktopPane.add(guiConsultaDeSetor);
            guiConsultaDeSetor.setVisible(true);
        }
    }//GEN-LAST:event_itemDeMenuConsultarSetorActionPerformed

    private void itemDeMenuCadastrarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuCadastrarFuncionarioActionPerformed

        // TODO add your handling code here:
        if((guiCadastroDeFuncionario == null) || (!guiCadastroDeFuncionario.isVisible())){
            guiCadastroDeFuncionario = new GUICadastroDeFuncionario();
            desktopPane.add(guiCadastroDeFuncionario);
            guiCadastroDeFuncionario.setVisible(true);
        }
    }//GEN-LAST:event_itemDeMenuCadastrarFuncionarioActionPerformed

    private void itemDeMenuCadastrarClientePessoaJuridicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemDeMenuCadastrarClientePessoaJuridicaActionPerformed
        // TODO add your handling code here:
        if((guiCadastroDeClientePessoaJuridica == null) || (!guiCadastroDeClientePessoaJuridica.isVisible())){
            guiCadastroDeClientePessoaJuridica = new GUICadastroDeClientePessoaJuridica();
            desktopPane.add(guiCadastroDeClientePessoaJuridica);
            guiCadastroDeClientePessoaJuridica.setVisible(true);
        }
        
    }//GEN-LAST:event_itemDeMenuCadastrarClientePessoaJuridicaActionPerformed

    /**
     * @param args the command line arguments
     */
    
/*//////////////////////////////////////////////////////////////////
    public static void main(String args[]) {
       

        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new GUIPrincipal().setVisible(true);
            }
        });
    }
*/////////////////////////////////////////////////////////////////////

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JMenuItem itemDeMenuAbrir;
    private javax.swing.JMenuItem itemDeMenuBaixaDeInsumos;
    private javax.swing.JMenuItem itemDeMenuCadastrarClientePessoaFisica;
    private javax.swing.JMenuItem itemDeMenuCadastrarClientePessoaJuridica;
    private javax.swing.JMenuItem itemDeMenuCadastrarFuncionario;
    private javax.swing.JMenuItem itemDeMenuCadastrarSetor;
    private javax.swing.JMenuItem itemDeMenuConsultaDeInsumos;
    private javax.swing.JMenuItem itemDeMenuConsultarCliente;
    private javax.swing.JMenuItem itemDeMenuConsultarFuncionario;
    private javax.swing.JMenuItem itemDeMenuConsultarSetor;
    private javax.swing.JMenuItem itemDeMenuIncluirObra;
    private javax.swing.JMenuItem itemDeMenuSair;
    private javax.swing.JMenuItem itemDeMenuSalvar;
    private javax.swing.JMenuItem itemDeMenuStatusObra;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JLabel lblImagem;
    private javax.swing.JMenu menuArquivo;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenu menuClientes;
    private javax.swing.JMenu menuFuncionarios;
    private javax.swing.JMenu menuImoveis;
    private javax.swing.JMenu menuInternoDeInsumosNasObras;
    private javax.swing.JMenu menuObras;
    private javax.swing.JMenu menuSetores;
    private javax.swing.JMenu subMenuCadastrarCliente;
    // End of variables declaration//GEN-END:variables
    
    
    private GUICadastroDeClientePessoaFisica guiCadastroDeClientePessoaFisica;
    private GUICadastroDeClientePessoaJuridica guiCadastroDeClientePessoaJuridica;
    private GUIConsultaDeCliente guiConsultaDeCliente;
    private GUICadastroDeSetor guiCadastroDeSetor;
    private GUIConsultaDeSetor guiConsultaDeSetor;
    private GUICadastroDeFuncionario guiCadastroDeFuncionario;
    
}
